package com.kongyz;

/**
 * @author kongyz
 * @date 2018/6/21 21:19
 * @Description:
 */
public class Singleton2 {
    private static Singleton2 instance;//私有静态变量
    private Singleton2(){}//私有构造方法
    //全局静态访问入口
    public static synchronized Singleton2 getInstance(){
        if(instance==null){
            instance=new Singleton2();
        }
        return instance;
    }
}
